package org.reenscape.skill;
import org.reenscape.updater.*;
import org.reenscape.model.*;
import org.reenscape.lib.*;
public class Magic {


			public void castOnNPC(PacketParser p3, int spell, int idx){
				switch(spell){
					//STRIKES
					case 1151:	/*WIND STRIKE*/		castOnNPC(idx, 2, p3, 1, 5.5, 90, 91, 92, 558, 556, 1, 1);		break;
					case 1154:	/*WATER STRIKE*/		castOnNPC(idx, 4, p3, 5, 7.5, 93, 94, 95, 558, 556, 555, 1, 1, 1);		break;
					case 1156:	/*EARTH STRIKE*/		castOnNPC(idx, 6, p3, 9, 9.5, 96, 97, 98, 558, 556, 557, 1, 1, 2);		break;
					case 1158:	/*FIRE STRIKE*/		castOnNPC(idx, 8, p3, 13, 11.5, 99, 100, 101, 558, 556, 554, 1, 2, 3);		break;
					//BOLTS
					case 1160:	/*WIND BOLT*/			castOnNPC(idx, 9, p3, 17, 13.5, 117, 118, 119, 562, 556, 1, 2);		break;
					case 1163:	/*WATER BOLT*/		castOnNPC(idx, 10, p3, 23, 16.5, 120, 121, 122, 562, 556, 555, 1, 2, 2);		break;
					case 1166:	/*EARTH BOLT*/			castOnNPC(idx, 11, p3, 29, 19.5, 123, 124, 125, 562, 556, 557, 1, 2, 3);		break;
					case 1169:	/*FIRE BOLT*/			castOnNPC(idx, 12, p3, 35, 21.5, 126, 127, 128, 562, 556, 554, 1, 3, 4);		break;
					//BLASTS
					case 1172:	/*WIND BLAST*/		castOnNPC(idx, 13, p3, 41, 25.5, 132, 133, 134, 560, 556, 1, 3);		break;
					case 1175:	/*WATER BLAST*/		castOnNPC(idx, 14, p3, 47, 28.5, 135, 136, 137, 560, 556, 555, 1, 3, 3);		break;
					case 1177:	/*EARTH BLAST*/		castOnNPC(idx, 15, p3, 53, 31.5, 138, 139, 140, 560, 556, 557, 1, 3, 4);		break;
					case 1181:	/*FIRE BLAST*/			castOnNPC(idx, 16, p3, 59, 34.5, 129, 130, 131, 560, 556, 554, 1, 4, 5);		break;
					//WAVES
					case 1183:	/*WIND WAVE*/		castOnNPC(idx, 17, p3, 62, 36, 158, 159, 160, 565, 556, 1, 5);		break;
					case 1185:	/*WATER WAVE*/		castOnNPC(idx, 18, p3, 65, 37.5, 161, 162, 163, 565, 556, 555, 1, 5, 7);		break;
					case 1188:	/*EARTH WAVE*/		castOnNPC(idx, 19, p3, 70, 40, 164, 165, 166, 565, 556, 557, 1, 5, 7);		break;
					case 1189:	/*FIRE WAVE*/			castOnNPC(idx, 20, p3, 75, 42.5, 155, 156, 157, 565, 556, 554, 1, 5, 7);		break;
					//UNCONFIGURED
					default:																									break;
				}
			}
			
			public void castOnNPC(int index, int damage, PacketParser p3, int req, double xp, int st, int md, int end, int rune1, int rune2, int rune1amt, int rune2amt){
				if(p3.playerLevel[6] < req){
						if((p3.AreXItemsInBag(rune1, rune1amt) && p3.AreXItemsInBag(rune2, rune2amt))){
							p3.resetWalkingQueue();
							p3.faceNPC(index);
							p3.setAnimation(711);
							p3.deleteItem(rune1, p3.GetItemSlot(rune1), rune1amt);
							p3.deleteItem(rune2, p3.GetItemSlot(rune2), rune2amt);
							Graphics.AttackNPC(index, p3, damage, xp, st, md, end);
						} else {
							p3.sendMessage("You do not have enough runes to cast this spell.");
						}
				} else {
					p3.sendMessage("You need a magic level of "+req+" to cast this spell.");
				}
			}
			
			public void castOnNPC(int index, int damage, PacketParser p3, int req, double xp, int st, int md, int end, int rune1, int rune2, int rune3, int rune1amt, int rune2amt, int rune3amt){
				if(p3.playerLevel[6] < req){
						if((p3.AreXItemsInBag(rune1, rune1amt) && p3.AreXItemsInBag(rune2, rune2amt) && p3.AreXItemsInBag(rune3, rune3amt))){
							p3.resetWalkingQueue();
							p3.faceNPC(index);
							p3.setAnimation(711);
							p3.deleteItem(rune1, p3.GetItemSlot(rune1), rune1amt);
							p3.deleteItem(rune2, p3.GetItemSlot(rune2), rune2amt);
							p3.deleteItem(rune3, p3.GetItemSlot(rune3), rune3amt);
							Graphics.AttackNPC(index, p3, damage, xp, st, md, end);
						} else {
							p3.sendMessage("You do not have enough runes to cast this spell.");
						}
				} else {
					p3.sendMessage("You need a magic level of "+req+" to cast this spell.");
				}
			}
}